package com.zyc.socket;


import com.zyc.factory.SingletonFactory;
import com.zyc.provider.impl.ServiceProviderImpl;
import com.zyc.remoting.transport.socket.SocketRpcServer;
import com.zyc.serviceImpl.HelloServiceImpl;

/**
 * @author zyc
 * @create 2022--05--10 15:49
 */
public class SocketServerMain {
    public static void main(String[] args) {
        // 服务端提供的所有服务实例对象
        HelloServiceImpl helloService = new HelloServiceImpl();

        // 基于socket通信,封装了服务端的socket
        SocketRpcServer socketRpcServer = new SocketRpcServer();

        // 将服务添加到注册中心
        socketRpcServer.registerService(helloService);

        // 服务端启动，监听来自客户端的请求
        socketRpcServer.start();
    }
}
